﻿define('viewModels/editcustomer', ['data/customers', 'logger', 'router', 'viewModel'], function (customerData, log, router, viewModel) {

    function view() {
        var self = this;

        function afterSave() {
            router.go('customerList');
        }

        viewModel.addEditItemBehavior(self, 'new customer', 'edit customer', customerData, customerData.Customer, afterSave);
        self.activate = function(params, bind) {
            self.start(params, bind);
        };
    }

    return new view();
});